package com.caishi.lkx.distribution.model;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@TableName("distribution_withdrawals")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DistributionWithdrawals {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String userId;
    private Long amount;
    private String bankInfo;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime withdrawalDate;
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;

    private StatusType status;
    private String openid;
    private String transferBillNo;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private Long totalAmount;
    public static enum StatusType {
        ACCEPTED,//：单据已受理
        PROCESSING,//：单据处理中，转账结果尚未明确，如一直处于此状态，建议检查账户余额是否足够
        WAIT_USER_CONFIRM,//：待收款用户确认
        TRANSFERING,//：转账中，转账结果尚未明确
        SUCCESS,//： 转账成功
        FAIL,//： 转账失败
        CANCELING,//： 撤销中
        CANCELLED;//： 已撤销
    }
}
